
package edu.washington.cs.pomdb;

import java.util.Random;

import edu.washington.cs.pomdb.gui.GUI;

/**
 * @author Yanping Huang
 * Subjects viewed sequences of bead colors drawn from hidden urns 
 * and attempted to infer the majority bead color in each urn. 
 * When viewing each bead color, subjects chose either to seek more evidence 
 * about the urn by drawing another bead (A_W) or to infer the urn contents (A_L or A_R). 
 */
public class RunTask {
	
	public static void main(String[] args){
		UserSet users = new UserSet(); 
		String userName = GUI.getUserName();
		
		User u;
		if(users.findByName(userName)){
			u = User.loadFile(userName);
		}else{
			u = new User(userName);
			users.register(userName);
		}
		
		u.welcome();
		
		Random r = new Random();
		while(u.newTrial(r.nextInt(ExpCtrl.coherenceLevels.length)));
		
		u.farewell();
		u.saveFile();
		users.saveFile();
		
	}
}
